package ch05;

import ch02.LL_1_Lexer.ListLexer;

/**
 * 词法单元类 Token
 */

public class Token {
    public int type;
    public String text;

    public static final int INVALID_TOKEN_TYPE = 0;
    public static final int PLUS = 1; // token types
    public static final int MULT = 2;
    public static final int DOT = 3;
    public static final int INT = 4;
    public static final int VEC = 5;
    public static final int ID = 6;
    public static final int ASSIGN = 7;
    public static final int PRINT = 8;
    public static final int STAT_LIST = 9;

    public Token(int type, String text) {
        this.type = type;
        this.text = text;
    }

    public Token(int type) {
        this.type = type;
    }

    public String toString() {
        return text;
    }
}
